package com.example.HQCource.pojo;

import com.alibaba.excel.EasyExcel;
import com.example.HQCource.pojo.user;
import org.junit.Test;

import java.util.ArrayList;
import java.util.List;

public class TextExcel {

    public static void main(String[] args) {
        String exclsNmae="C:\\Users\\小酷\\Desktop\\excel.xlsx";
        EasyExcel.write(exclsNmae, user.class).sheet("写").doWrite(data());
    }
    public  static List<user> data(){
        List<user> users=new ArrayList<>();
        for (int a=0;a<=20;a++){
            user user=new user();
            user.setId(a);

            users.add(user);
        }
        return users;
    }
    @Test
    public void demo(){
        String exclsNmae="C:\\Users\\小酷\\Desktop\\modo.xlsx";
        EasyExcel.read(exclsNmae, user.class,new excelListener()).sheet().doRead();
    }
}
